package com.norteksoft.erm.model;

import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * 角色自定义分类
 * 
 * @author Jiffy
 * @hibernate.class table="ERM_ROLECATEGORY"
 * 
 */
public class RoleCategory extends BaseObject {

	private Long OID = new Long(-1);// OID

	private String name;// 类别名称

	private String code;// 类别标识（必须唯一）

	private String memo;// 备注

	private Set myRoles = new HashSet();

	public int hashCode() {
		return new HashCodeBuilder().append(OID).append(name).append(code)
				.append(memo).toHashCode();
	}

	/**
	 * @hibernate.id column="OID" unsaved-value="-1" type="long"
	 * @hibernate.generator class="sequence"
	 * @hibernate.param name="sequence" value="ERM_SEQUENCE"
	 */
	public Long getOID() {
		return OID;
	}

	public void setOID(Long oid) {
		OID = oid;
	}

	/**
	 * @hibernate.property column="NAME" length="60" type="string"
	 *                     not-null="true"
	 * @return String
	 */
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @hibernate.property column="CODE" length="60" type="string"
	 *                     not-null="true"
	 * @return String
	 */

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @hibernate.set lazy="true" inverse="true" cascade="save-update"
	 *                order-by="roleName asc"
	 * @hibernate.key column="ROLECATEGORYOID"
	 * @hibernate.one-to-many class="com.norteksoft.erm.model.Role"
	 * @return Set
	 */

	public Set getMyRoles() {
		return myRoles;
	}

	public void setMyRoles(Set myRoles) {
		this.myRoles = myRoles;
	}

	/**
	 * @hibernate.property column="MEMO" length="1000" type="string"
	 * @return String
	 */
	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}
	

}
